package com.xujie.sportsmeeting.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 项目报名响应VO
 */
@Data
@Schema(description = "项目报名响应信息")
public class EventRegistrationVO {

    @Schema(description = "报名ID")
    private Long id;

    @Schema(description = "项目ID")
    private Long eventId;

    @Schema(description = "项目名称")
    private String eventName;

    @Schema(description = "运动员ID")
    private Long athleteId;

    @Schema(description = "运动员姓名")
    private String athleteName;

    @Schema(description = "运动员学号")
    private String studentNumber;

    @Schema(description = "报名编号")
    private String registrationNumber;

    @Schema(description = "团队名称")
    private String teamName;

    @Schema(description = "报名时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime registrationTime;

    @Schema(description = "审核状态")
    private Integer auditStatus;

    @Schema(description = "审核状态描述")
    private String auditStatusText;

    @Schema(description = "审核时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime auditTime;

    @Schema(description = "审核人ID")
    private Long auditUserId;

    @Schema(description = "审核人姓名")
    private String auditUserName;

    @Schema(description = "审核备注")
    private String auditRemark;

    @Schema(description = "报名备注")
    private String remarks;

    @Schema(description = "状态")
    private Integer status;

    @Schema(description = "状态描述")
    private String statusText;

    @Schema(description = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    // 获取审核状态描述
    public String getAuditStatusText() {
        if (auditStatus == null) return "";
        switch (auditStatus) {
            case 0: return "待审核";
            case 1: return "审核通过";
            case 2: return "审核拒绝";
            default: return "";
        }
    }

    // 获取状态描述
    public String getStatusText() {
        if (status == null) return "";
        return status == 1 ? "正常" : "已取消";
    }
}
